/**
 *
 * @param Child  子类
 * @param Parent 父类
 */
function myExtends(Child, Parent) {
  Child.prototype.__proto__ = Object.create(Parent.prototype);
}

function A(props, params) {
  B.call(this, props);
  this.params = params;
}

A.prototype.sayParams = function () {
  return this.params;
};

function B() {

}

B.prototype.sayB = function () {
  return 'B';
};

/*实现继承*/
myExtends(A, B);
console.log(new A().sayB());
console.log(new A(10, 20).sayParams());
console.log(A.prototype.constructor === A);


